<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <div id="app">
  
      <home/>
  </div>
  <script src="./vue.js"></script>
  <script>
    const Child = {
      template: `
        <div>
          <slot :msg="msg" :arr="arr" c="1111"></slot>
          <h3>子组件头部</h3>  
          <h3>子组件尾部</h3>
        </div>
      `,
      data(){
        return {
          msg: '子组件数据',
          arr: ['a', 'b', 'c', 'd']
        }
      }
    }
    const Home = {
      template: `
        <div>
          <h2>父组件</h2>
          <child>
            <div slot-scope="data">
              
              <mark>{{data.msg}}</mark>  
              
            </div>   
          </child>
        </div>
      `,
      components: {
        Child
      }
    }
    Vue.component("Home", Home)
    const vm = new Vue({
      el: '#app'
    })
  </script>
</body>
</html>